<template>
  <s-table
    :columns="columns"
    :scroll="{ y: 400 }"
    :pagination="false"
    :data-source="dataSource"
  ></s-table>
</template>
<script lang="ts">
import { defineComponent, ref } from "vue";

interface DataItem {
  key: number;
  name: string;
  age: number;
  address: string;
}

export default defineComponent({
  setup() {
    const columns = [
      {
        title: "姓名",
        dataIndex: "name",
      },
      {
        title: "年龄",
        dataIndex: "age",
      },
      {
        title: "身份证号",
        dataIndex: "address",
      },
      {
        title: "家庭住址",
        dataIndex: "address",
      },
      {
        title: "Column 3",
        dataIndex: "address",
      },
      {
        title: "Column 4",
        dataIndex: "address",
      },
      { title: "Column 5", dataIndex: "address" },
    ];
    const data: DataItem[] = [];
    for (let i = 0; i < 1000; i++) {
      data.push({
        key: i,
        name: `Edrward ${i}`,
        age: i + 1,
        address: `London Park no. ${i}`,
      });
    }
    return {
      dataSource: ref(data),
      columns: ref(columns),
    };
  },
});
</script>
